{% extends "base_generic.html" %}

{% block content %}
<h1>个性化书籍推荐</h1>

{% if book_list %}
  <div class="book-list">
    {% for book in book_list %}
      <div class="book-item">
        <h2><a href="{{ book.get_absolute_url }}">{{ book.title }}</a></h2>
        <p>作者: {{ book.author }}</p>
        {% if book.summary %}
          <p>{{ book.summary|truncatewords:30 }}</p>
        {% endif %}
        <p>评分: {{ book.average_rating|floatformat:1 }} ({{ book.rating_count }} 评价)</p>
        <p>借阅次数: {{ book.borrow_count }}</p>
      </div>
    {% endfor %}
  </div>
{% else %}
  <p>暂无推荐书籍。请先浏览并点赞或收藏书籍，以获取个性化推荐。</p>
{% endif %}
{% endblock %}